Skip to content

Sync: report product names as ProductID so synced certificates get a template (issue 0097) - #43

Merged
spbsoluble merged 6 commits into
feat/v2-followups-round2from
fix/0097-sync-productid-name
Nov 17, 2026
Merged

spbsoluble merged 6 commits into
feat/v2-followups-round2from
fix/0097-sync-productid-name

Conversation

@spbsoluble

@spbsoluble spbsoluble commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Sync now reports product names (like DV SSL) as ProductID instead of CERTInext product codes (like 842). The gateway can then match synced certificates to a template.

Fixes

  • Why certificates had no template: the gateway gives a synced certificate a template only when its ProductID equals a template's product name. Sync sent the code, so certificates ordered outside Command reached Command with no template.
  • How names are found:
    • Each sync pass reads the account's catalog once.
    • It maps each code to its product type, then to the plugin's product name.
    • There's no fixed code table, because codes differ by account.
  • When no name is found: an unknown code, an unsupported product type, or a failed catalog read (one warning) keeps the code, as before. Sync never fails over this.
  • Sync summary: now shows ProductNames: Resolved=…, Unresolved=….
  • GetSingleRecord: unchanged.

Testing

  • Unit tests: 1347 passed, and 1262 with DcvSupport=false.
  • Release builds: 0 warnings in both configs.
  • New SyncProductIdTests:
    • Each product type maps to its name.
    • V2 sync with sandbox codes, with one catalog read.
    • A catalog failure.
    • A row with no code.
    • V1 sync.
  • Live, read-only: SyncProductIdLiveTests (V1 and V2 sandbox catalogs match), and V2FulfilledPendingSyncLiveTests now checks that ProductID is a name.

Other

…sign synced certificates a template

The gateway gives a synced record a certificate profile only when its ProductID
equals a configured template's ProductID (a GetProductIds() name) exactly
(Gateway-AnyCA-REST CertificateService.CreateOrUpdateDBCertificate, called only from
CASyncJob). Both syncs sent CERTInext product codes, which never matched: all 927
sync-created lab rows had no profile, and those certificates reached Command with no
template.

Each V1/V2 sync pass now reads the account catalog once (on first use) and names a
code by productTypeID via the inverse of ProductTypeIdsV2. No fixed code table: the
V1-era DefaultProductCodes would label the sandbox's DV 842 'OV SSL'. Unknown codes,
types with no plugin product, and an unreadable catalog (one warning) keep the code.
The sync summaries gain ProductNames Resolved/Unresolved. GetSingleRecord is
unchanged: the gateway doesn't use its ProductID for the mapping.

Includes a read-only catalog probe (V1 and V2 catalogs are identical on the sandbox).
…ad-only)

Explains why a gateway row isn't re-saved by the sync. Opt-in with
CERTINEXT_SYNC_PRODUCTID_PROBE=1 and CERTINEXT_PROBE_ORDERS. Live 2026-11-16: the 8
gateway rows still pending without a profile are all 'Order Cancelled | Rejected due
to Order Cancellation' (Track: cancelled), which the sync skips.
… still holds it as pending

Both syncs skip orders cancelled or rejected at CERTInext, and the gateway changes a
row only when the sync emits a record for it, so an order it held as pending stayed
pending indefinitely (8 kfclab rows, all 'Order Cancelled | Rejected due to Order
Cancellation', Track: cancelled). Before skipping, the sync now asks the gateway
(ICertificateDataReader.GetStatusByRequestID): held as pending -> emit failed with no
certificate, once. No row (ArgumentException), already terminal, issued/revoked
(never downgraded), no reader, or a lookup error keep the skip. Summaries gain
FailedPropagated. Issue 0098.
@spbsoluble
spbsoluble added this pull request to stack #45 November 17, 2026 03:19
spbsoluble and others added 2 commits November 16, 2026 20:02
…ildcard CN

A DV/OV request with CN = apex and SAN = *.apex failed with EMS-1173: the
wrapper keys "wildcard" on certificate.domain alone and resolved a plain
UCC product. Sending the wildcard as the domain is rejected too (EMS-1056,
the domain must match the CSR CN). Both confirmed live.

With no template ProductCode, the plugin now reads the catalog and sends
the account's single active Wildcard UCC product (typeID 21 DV / 22 OV) as
X-Product-Code. No match, several matches, a catalog failure, or EV fails
before any order is placed, asking for ProductCode.

Adds unit coverage and an opt-in live probe (CERTINEXT_V2_WILDCARD_SAN_PROBE).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant